package clazz.generic;

import entity.People;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 李栋
 * @version 1.0.0
 * @className GenericTest.java
 * @createTime 2021年08月17日 21:45:00
 */
public class GenericTest {

    private static final Logger logger = LoggerFactory.getLogger(GenericTest.class);

    @Test
    public void test() {
        List<String> l1 = new ArrayList<>();
        List<Integer> l2 = new ArrayList<>();
        logger.info(String.valueOf(l1.getClass() == l2.getClass()));
    }


    @Test
    public void test1() {
        Class<People> object = GenericDemo.getObject(People.class);
        logger.info(String.valueOf(object));
    }

    @Test
    public void test2() {
        Class<?> aClass = GenericDemo.testOne(People.class);
        logger.info(String.valueOf(aClass));
    }

    /**
     * 参数是 类类型 获得 类的对象
     */
    @Test
    public void test3() {
        PageInfoItem<People> pageInfo = GenericDemo.getPageInfo(People.class);
        People people = pageInfo.getItem();
        logger.info(people.toString());
    }


}
